import Vue from 'vue'
import App from './App'
import helper from './helper/helper.js';


const WebIM = (wx.WebIM = require('./utils/WebIM')['default']);
const emedia = (wx.emedia = require('./emedia/emedia_for_miniProgram'));
const disp = require('./utils/broadcast');

let conn = {
	closed: false,
	curOpenOpt: {},
	open(opt) {
		this.curOpenOpt = opt;
		WebIM.conn.open(opt);
		this.closed = false;
	},
	reopen() {
		if (this.closed) {
			//this.open(this.curOpenOpt);
			WebIM.conn.open(this.curOpenOpt);
			this.closed = false;
		}
	}
};

// uviewui.com
import uView from "uview-ui";
Vue.use(uView);

Vue.prototype.$im = WebIM;
Vue.prototype.$conn = conn;
Vue.prototype.$emedia = emedia;
Vue.prototype.$disp = disp

Vue.prototype.$helper = helper;

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
